import Vue from 'vue'
import Vuex from 'vuex'
import VuexPersist from 'vuex-persist'

Vue.use(Vuex)

const vuexLocal = new VuexPersist({
  storage: window.localStorage
})


export default new Vuex.Store({
  state: {
    login_token: '',
    token: '',
    merId: '',
    email: ''
  },
  getters: {
  },
  mutations: {
    login_token(state,val){
        state.login_token = val
    },
    token(state,val){
      state.token = val
    },
    merId(state,val){
      state.merId = val
    },
    email(state,val){
      state.email = val
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [vuexLocal.plugin]
})
